#define _CRT_SECURE_NO_WARNINGS 1


#include<iostream>
using namespace std;
int a[1200000];
int main()
{
    int n;
    cin >> n;
    for (int t = 1;t <= n;t++) cin >> a[t];
    int l = 1, x, k = n + 1;
    cin >> x;
    for (int t = n;t >= l;t--)
    {
        if (a[t] > x)
        {
            k = t;
            l++;
        }
    }
    cout << k << endl;
}